SkeletonTransform
SkeletonTransform[image] gives the skeleton transform of image, in which the value of each skeleton pixel is its distance to the nearest background pixel.
SkeletonTransform[image,t] treats values above t as foreground.
Please visit the official Wolfram Language Reference for more details and examples on core symbols.